import { defineConfig } from 'vite'
import uni from '@dcloudio/vite-plugin-uni'

export default defineConfig(() => {
	return {
		plugins: [
			uni()
		],
		build: {
			minify: 'terser',
			terserOptions: {
				compress: {
					drop_console: true
				}
			},
			rollupOptions: {
				output: {
					manualChunks(id) {
						if (id.includes('node_modules')) {
							return 'vendor'
						}
					}
				}
			}
		},
		server: {
			port: 8001,
			proxy: {
				"/api": {
					"target": "https://appapi.gpal.cn",
					"changeOrigin": true
				}
			}
		}
	}
});